package com.hcinfos.gsoo.adapter;

import java.util.List;

import com.hcinfos.gsoo.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class MyDiancaiAdapter extends BaseAdapter {

	private List<String> list;
	private LayoutInflater lif;

	public MyDiancaiAdapter(Context context, List<String> list) {

		this.list = list;
		lif = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		Holder holder;
		if (convertView == null) {
			holder = new Holder();
			convertView = lif.inflate(R.layout.adapter_my_diancai_list_item,
					null);

			convertView.setTag(holder);
		} else {
			holder = (Holder) convertView.getTag();

		}
		return convertView;
	}

	public final class Holder {

		TextView time_tv;
		TextView name_tv;
		ImageView top_iv;
		ImageView bottom_iv;
		TextView money_tv;
		TextView moneyNum_tv;
		Button del_bt;
		Button update_bt;
		Button order_bt;

	}

	public void setDataChange(List<String> list) {
		this.list = list;
	}

}
